<script>
import {defineComponent} from 'vue'

export default defineComponent({
    name: "Child",
    data(){
        return {
            money:2000
        }
    },
    methods:{
        fn3(){
            // console.log(this.$parent);
            this.$parent.money-=10;
            this.money+=10;
        }
    }
})
</script>

<template>
    <div>
        <h3>Child</h3>
        <p>儿子有{{money}}元</p>
        <button @click="fn3">向父亲像10元</button>
    </div>
</template>

<style scoped>

</style>